package com.ruoyi.bearing.service.impl;

import java.util.List;

import com.ruoyi.common.constant.FlaskModelConstants;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.flask.HttpFlask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bearing.mapper.BearingBasicInfoMapper;
import com.ruoyi.bearing.domain.BearingBasicInfo;
import com.ruoyi.bearing.service.IBearingBasicInfoService;

/**
 * 部门Service业务层处理
 *
 * @author ruoyi
 * @date 2023-06-30
 */
@Service
public class BearingBasicInfoServiceImpl implements IBearingBasicInfoService {
    @Autowired
    private BearingBasicInfoMapper bearingBasicInfoMapper;

    /**
     * 查询部门
     */
    @Override
    public BearingBasicInfo selectBearingBasicInfoById(Long id) {

        return bearingBasicInfoMapper.selectBearingBasicInfoById(id);
    }

    public String startTestModelTrainSystem() {
        return HttpFlask.sendGetFlask(FlaskModelConstants.QT_TEST);
    }

    /**
     * 查询部门列表
     */
    @Override
    public List<BearingBasicInfo> selectBearingBasicInfoList(BearingBasicInfo bearingBasicInfo) {
        return bearingBasicInfoMapper.selectBearingBasicInfoList(bearingBasicInfo);
    }

    /**
     * 新增部门
     */
    @Override
    public int insertBearingBasicInfo(BearingBasicInfo bearingBasicInfo) {
        bearingBasicInfo.setCreateTime(DateUtils.getNowDate());
        return bearingBasicInfoMapper.insertBearingBasicInfo(bearingBasicInfo);
    }

    /**
     * 修改部门
     */
    @Override
    public int updateBearingBasicInfo(BearingBasicInfo bearingBasicInfo) {
        bearingBasicInfo.setUpdateTime(DateUtils.getNowDate());
        return bearingBasicInfoMapper.updateBearingBasicInfo(bearingBasicInfo);
    }

    /**
     * 批量删除部门
     */
    @Override
    public int deleteBearingBasicInfoByIds(Long[] ids) {
        return bearingBasicInfoMapper.deleteBearingBasicInfoByIds(ids);
    }

    /**
     * 删除部门信息
     */
    @Override
    public int deleteBearingBasicInfoById(Long id) {
        return bearingBasicInfoMapper.deleteBearingBasicInfoById(id);
    }
}
